package org.iabako.shared.querydefinition.dto;

import org.iabako.shared.querydefinition.columndefinition.ColumnDefinition;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * TODO javadoc
 * Date: 24/11/13
 * Time: 18:22
 */
public class QueryResultDTO implements Serializable {

    private static final long serialVersionUID = 7440297955003302414L;

    private Long id;
    private Long idModificationAction;
    private String idPrefix;
    public Map<ColumnDefinition, QueryResultValue> values;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getIdModificationAction() {
        return idModificationAction;
    }

    public void setIdModificationAction(Long idModificationAction) {
        this.idModificationAction = idModificationAction;
    }

    public String getIdPrefix() {
        return idPrefix;
    }

    public void setIdPrefix(String idPrefix) {
        this.idPrefix = idPrefix;
    }

    public Map<ColumnDefinition, QueryResultValue> getValues() {
        if (values == null) {
            values = new LinkedHashMap<ColumnDefinition, QueryResultValue>();
        }
        return values;
    }

    public void addValue(ColumnDefinition columnDefinition, QueryResultValue value) {
        getValues().put(columnDefinition, value);
    }
}
